import Vue from "vue";
import VueRouter from "vue-router";
import MyLogin from "@/views/MyLogin.vue";
import MyInfo from "@/views/MyInfo.vue";
import NotFound from "@/views/NotFound.vue";
import MyUser from "@/views/MyUser.vue";
import MyArticle from "@/views/MyArticle.vue";
import WenZhou from "@/views/WenZhou.vue";
import HangZhou from "@/views/HangZhou.vue";
import ZheJiang from '@/views/ZheJiang.vue'
Vue.use(VueRouter);
const router = new VueRouter({
  // mode: 'history', //不写这个就是hash值，没有#了就更美观了，但写了后就需要后端配合
  routes: [
    // /路由重定向，页面打开的时候时空的，我们可以让路由直接切换到/login
    { path: "/", redirect: "/login" },
    { path: "/login", component: MyLogin },
    { path: "/info", component: MyInfo },
    { path: "/user", component: MyUser },
    { path: '/article/:id', component: MyArticle, name: 'article' },
    // { path: '/zhejiang/hangzhou', component: HangZhou },
    // { path: '/zhejiang/wenzhou', component: WenZhou }, 
    {
      path: '/zhejiang',
      component: ZheJiang,
      children: [
        { path: 'hangzhou', component: HangZhou },
        { path: 'wenzhou', component: WenZhou }
      ]
    },
// 官方语言放最后
    { path: "*", component: NotFound },
  ],
});
export default router;
